#include <iostream>
#include <future>
using namespace std;

int func(promise<int> f) {
    f.set_value(1000);
}

int main()
{
    promise<int> f;
    auto ret=f.get_future();

    thread t1(func,move(f));

    t1.join();
    cout<<ret.get()<<endl;
}